﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Entity
{
    public class ProductType
    {
        #region Fields
        private int typeId;
        private string tam;

        public string Tam
        {
            get { return tam; }
            set { tam = value; }
        }
        private ProductType _parentType;        
        private string name;
        private string description;
        private bool visible;
        #endregion

        #region Properties
        IList<Product> _listProduct = new List<Product>();
        public int TypeId
        {
            get { return typeId; }
            set { typeId = value; }
        }

        public ProductType ParentType
        {
            get { return _parentType; }
            set { _parentType = value; }
        }

        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        public string Description
        {
            get { return description; }
            set { description = value; }
        }

        public bool Visible
        {
            get { return visible; }
            set { visible = value; }
        }
        #endregion    
        public void add(Product _product)
        {
            _listProduct.Add(_product);
        }
        public void remove(Product _product)
        {
            _listProduct.Remove(_product);
        }
        public bool check(Product _product)
        {
            foreach (Product item in _listProduct)

            {

                if (item.ProductId == _product.ProductId)
                    return true;
            }
            return false;

        }
        public override string ToString()
        {
            return this.name;
        }
    
    }
}
